package com.bhkj.pdjhforotherapp.app;

import android.app.Application;

import com.bhkj.pdjhforotherapp.common.Contact;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.CrashUtils;
import com.blankj.utilcode.util.LogUtils;
import com.tencent.bugly.crashreport.CrashReport;
import com.zhouyou.http.EasyHttp;

public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        CrashUtils.init((crashInfo, e) -> {
            AppUtils.relaunchApp();
        });

        EasyHttp.init(this);
        EasyHttp.getInstance().debug("PDQH", false)
                .setBaseUrl(Contact.BASE_URL)
                .setRetryCount(1)
                .setReadTimeOut(20 * 1000)
                .setWriteTimeOut(30 * 100)
                .setConnectTimeout(30 * 100);
        CrashReport.initCrashReport(this, "aefae71a8c", false);
        LogUtils.getConfig().setLogSwitch(false);

    }


//    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
//    public void registerActivityLifecycleCallback(Application.ActivityLifecycleCallbacks callbacks) {
//        getApplication().registerActivityLifecycleCallbacks(callbacks);
//    }


}
